﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" 
Inherits="System.Web.Mvc.ViewPage<ZXCompany.Models.Entity.ZX_HomePageImage>" %>
<%@ Import Namespace="ZXCompany.DBUtil" %>
<%@ Import Namespace="ZXCompany.Models.Entity" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%
   
    string HomeAction = Request.QueryString["action"] == null ? "" : Request.QueryString["action"].ToString();
    if (HomeAction!="add")
    { 
 %>
 
    <div class="tabtitle" style=" width:80%;">
	<ul id="mytab1">
		<li class="active">首页图片管理</li>
		<li class="normal" onclick="javascript:window.location.href = '../Account/HomePageImage.aspx?action=add&hp_id=0';">首页图片添加</li>
        <%--onclick="javascript:window.open('ppt_list.asp?action=add','right');"--%>
	</ul>
</div>
<form action="<%=VirtualPath.getVirtualPath()%>/Account/HomePageImage.aspx" method="post" id="HomePageImage" name="HomePageImage">        
<div class="config" style=" width:80%;">
<table class="ta" style=" text-align:center;">
  <tr>
    <th colspan="6" style="background: none repeat scroll 0% 0% rgb(102, 187, 255);"></th>
  </tr>
  <tr style=" height:20px;background: #eeeeff;"><td colspan="6"></td></tr>
  <tr style="background: #8899cc; font-size:13px; font-weight:bold; height:40px;"> 
    <td style="background: #eeeeff; width:10%"></td>
  	<td width="8%">序号</td>
    <td width="40%">图片</td>
    <td width="15%">排序</td>
    <td width="10%"></td>
    <td style="background: #eeeeff; width:10%"></td>
  </tr>
  <%      
    IList<ZX_HomePageImage> HPImageList = ViewData["Account_HPImage"] as IList<ZX_HomePageImage>;
    for (int i = 0; i < HPImageList.Count; i++)
    {
%>
  <tr> 
    <td style="background: #eeeeff; width:10%"></td>
  	<td width="5%"><% =i +1 %></td>
    <td width="40%" align="left"><a href="<% =HPImageList[i].imageHref %>" target="_blank">
        <img src="<%=HPImageList[i].imageUrl %>" width="400" height="300" border="0"/></a>       
    </td>
    <td width="15%"><% =HPImageList[i].sort %></td>
    <td width="10%" style=" color:#00f">
        <a href="HomePageImage.aspx?action=add&hp_id=<% =HPImageList[i].ID %>">编辑</a> |
        <a href="HomePageImage.aspx?action=del&hp_id=<% =HPImageList[i].ID %>" onclick="if(!confirm('确定删除该幻灯片么？'))return false;">
        删除</a> <%--HomePageImage_Del?action=del&id=--%>
    </td>
    <td style="background: #eeeeff; width:10%"></td>
  </tr>
  <%   
    }      
  %>
</table>
</div>
</form>
 <%
    }
    else
    { 
%>
<div class="tabtitle" style="width:80%;">
	<ul id="Ul1">
		<li class="normal" onclick="javascript:window.location.href = '../Account/HomePageImage.aspx';">首页图片管理</li>
		<li class="active">首页图片添加</li>
	</ul>
</div> <%--onsubmit="return check_file()"--%>
<form method="post" action="<%=VirtualPath.getVirtualPath()%>/Account/HomePageImage_Edit.aspx" enctype="multipart/form-data"
    id="HomePageImage_Edit" name="HomePageImage_Edit">
<div class="config" style="width:80%;">
	<table class="ta" >
	<tbody>
    <tr class="tdodd">
        <th style="background: none repeat scroll 0% 0% rgb(102, 187, 255);" colspan="4">
        </th>
    </tr>
    <tr><td style="background: #eeeeff; height:20px;" colspan="4"></td></tr>
	<tr class="">
    <td style="background: #eeeeff; width:10%"></td>
        <td style=" text-align:center; width:120px; height:40px;">图片地址：</td>
        <%--http://www.cnblogs.com/Tiramisu/archive/2009/02/09/1385405.html  图片上传 --%>
        <td align="left"> 
            <input type="file" id="imageUrl" size="40" outhtml ="<% =Model.imageUrl %>"
                value="<% =Model.imageUrl %>" name="imageUrl"  onfocus="this.className='input_on';this.onmouseout=''" 
                onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" 
                onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"/>
            <%--<input type="file" name="file" onpropertychange="imageUrl.value=this.value" style="display:none"/>     
            <input type="text" id="imageUrl" name="imageUrl"  readonly="readonly" value=<% =Model.imageUrl %> onfocus="this.className='input_on';this.onmouseout=''" 
                onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" 
                onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"/>     
            <input type="button" value="浏览…" id="button1" name="button1" onclick="file.click()"/> --%>
	    </td>
        <td style="background: #eeeeff; width:10%"></td>
    </tr>
	<tr class="tdodd">
        <td style="background: #eeeeff; width:10%"></td>
        <td style=" text-align:center; height:40px;">图片链接：</td>
        <td align="left"> 
            <input class="input_out" onfocus="this.className='input_on';this.onmouseout=''" 
            onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" 
            onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" style="padding: 2px; width: 450px;" 
            value="<% =Model.imageHref %>" name="imageHref" size="40"/> <%--type="hidden"--%>
	    </td>
        <td style="background: #eeeeff; width:10%"></td>
    </tr>
	<tr>
        <td style="background: #eeeeff; width:10%"></td>
        <td style=" text-align:center; height:40px;">图片顺序：</td>
        <td align="left"> 
            <input class="input_out" onfocus="this.className='input_on';this.onmouseout=''" 
            onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" 
            onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" style="padding: 2px; width: 450px;" 
            value="<% =Model.sort %>" name="sort" size="40" type="text"/>

	    </td>
        <td style="background: #eeeeff; width:10%"></td>
    </tr>
    <tr>
        <td style="background: #eeeeff; width:10%"></td>
        <td></td>
        <td style=" text-align:center; height:40px;">
            <input type="submit" id="infoSave" value="保存" class="input2"/>
             <%--onclick="javascript:window.location.href ='../Account/HomePageImage';"--%>
            <%--<input type="hidden" value="<%=Model.Lexpert %>" name="Lexpert" id="Lexpert"/>--%>
            <input type="hidden" value="<%=Model.ID %>" name="ID" id="ID"/>
        </td>
        <td style="background: #eeeeff; width:10%"></td>
    </tr>
    <tr><td style="background: #eeeeff; height:20px;" colspan="4"></td></tr>
	</tbody>
    </table>
</div>
</form>
 <%       
}%>
<script type="text/javascript">
    $("#trainlist").find("td").css("border", "#bbddff solid 1px").css("background", "fefefe");
</script>
</asp:Content>
